<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        strong{
            display: inline-block;
            width: 100px;
            height: 100px;
            border-radius: 50%;
            background: pink;

            text-align: center;
            line-height: 100px;
        }
    </style>
</head>
<body>
<div id="app">
    <v-count :count="count"></v-count>
</div>
</body>
<script src="../js/vue.js"></script>
<script>
    Vue.config.productionTip = false;
    new Vue({
        el:"#app",
        data:{count:101},
        components:{
            "v-count":{
                //props:{count:Number}, //类型验证
                //props:{count:[Number,String]}, //类型验证
                props:{
                    count:{
                        type:Number,
                        required:false,
                        default:10,
                        validator: function (value) {
                            // 这个值必须匹配下列字符串中的一个
                            return value > 100
                        }
                    }
                },
                template:"<strong>{{count}}</strong>"
            }
        }
    })
</script>
</html>